const mongoose = require('mongoose')




module.exports = (onSuccess,onError)=>{
    
    const promise =  mongoose.connect('mongodb://127.0.0.1:27017/book')
    mongoose.connection.on('open',()=>{
        console.log('连接数据库成功');
    })
    mongoose.connection.on('error',()=>{
        console.log('连接数据库失败');
    })

    return promise 
}